﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using Abp.Domain.Entities.Auditing;
using FwProject.ShoppingMall.EventAdvertising;

namespace FwProject.EventAdvertising.Dto
{
    /// <summary>
    /// 商城优惠券模型
    /// </summary>
    [AutoMap(typeof(ShopCoupon))]
    public class ShopCouponDto: EntityDto<Guid>, ICreationAudited
    {
        /// <summary>
        /// 默认0全品1,单类别，使用类别
        /// </summary>
        [Display(Name = "使用类别")]
        public CouponType CouponType { get; set; } = CouponType.All;

        /// <summary>
        /// 适用范围
        /// </summary>
        [Display(Name = "适用范围")]
        public UseCoupon UseCoupon { get; set; } = UseCoupon.Universal;


        /// <summary>
        /// 商品类别Id
        /// </summary>
        [Display(Name = "类别Id")]
        public Guid? ProductTypeId { get; set; }
        /// <summary>
        /// 优惠券金额
        /// </summary>
        [Display(Name = "优惠券金额")]
        public decimal CouponPrice { get; set; } = 0m;

        /// <summary>
        /// 默认0 满减使用
        /// </summary>
        [Display(Name = "满减使用")]
        public decimal UsePrice { get; set; } = 0m;

        /// <summary>
        /// 优惠券显示图片
        /// </summary>
        [Display(Name = "优惠券显示图片")]
        public string CouponPic { get; set; }

        public string CouponNotPic { get; set; }

        /// <summary>
        /// 开始使用时间
        /// </summary>
        [Display(Name = "开始使用时间")]
        public DateTime UseBeginTime { get; set; }

        /// <summary>
        /// 结束使用时间
        /// </summary>
        [Display(Name = "结束使用时间")]
        public DateTime UseEndTime { get; set; }

        /// <summary>
        /// 发行数量
        /// </summary>
        [Display(Name = "发行数量")]
        public int CouponCount { get; set; }

        /// <summary>
        /// 优惠券名称
        /// </summary>
        [Display(Name = "优惠券名称")]
        public string CouponTitile { get; set; }

        /// <summary>
        /// 优惠券描述
        /// </summary>
        [Display(Name = "优惠券描述")]
        public string CouponDescribe { get; set; }

        public long? CreatorUserId { get; set; }
        public DateTime CreationTime { get; set; }
    }

    public class ShopCouponOutputDto:EntityDto<Guid>
    {
        /// <summary>
        /// 优惠券名称
        /// </summary>
        public string CouponTitile { get; set; }

        /// <summary>
        /// 实用类别
        /// </summary>
        public CouponType CouponType { get; set; }

        /// <summary>
        /// 适用范围
        /// </summary>
        public UseCoupon UseCoupon { get; set; }

        /// <summary>
        /// 优惠券金额
        /// </summary>
        public decimal CouponPrice { get; set; }

        /// <summary>
        /// 开始使用时间
        /// </summary>
        public DateTime UseBeginTime { get; set; }

        /// <summary>
        /// 结束使用时间
        /// </summary>
        public DateTime UseEndTime { get; set; }

        /// <summary>
        /// 发行数量
        /// </summary>
        public int CouponCount { get; set; }

        /// <summary>
        /// 使用数量
        /// </summary>
        public int UseCount { get; set; }

    }

}
